package com.lyc.common.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lyc.common.serializer.Date2LongSerialize;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;

/**
 * Created by 廖师兄
 * 2017-05-29 17:22
 */
@Data
@Entity
@DynamicUpdate
@DynamicInsert
public class BookCollect {

    @Id
    private String collectId;

    private String uid;

    private String bookId;

    /** 顺序,越大优先级越高. */
    private Integer collectRank;

    @JsonSerialize(using = Date2LongSerialize.class)
    private Date createTime;

    @JsonSerialize(using = Date2LongSerialize.class)
    private Date updateTime;

    @Transient
    private String bookName;

    @Transient
    private String bookAuthor;

    @Transient
    private String bookImage;

    @JsonSerialize(using = Date2LongSerialize.class)
    @Transient
    private Date publishTime;

    @Transient
    private String bookDownloadUrl;


}
